<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{ site_title }}</title>
    <link href="static/vendor/bootstrap.min.css" rel="stylesheet">
    <link href="static/vendor/all.min.css" rel="stylesheet">
    <link href="static/css/style.css" rel="stylesheet">
</head>
<body>
    <!-- 导航栏 -->
    <nav class="navbar navbar-expand-lg sticky-top">
        <div class="container">
            <a class="navbar-brand" href="/">{{ site_title }}</a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav">
                    <li class="nav-item">
                        <a class="nav-link active" href="/">首页</a>
                    </li>
                </ul>
                <!-- 搜索框 -->
                <form class="d-flex ms-auto">
                    <input class="form-control me-2" type="search" placeholder="搜索资源..." id="searchInput">
                    <button class="btn btn-outline-light" type="submit">
                        <i class="fas fa-search"></i>
                        搜索
                    </button>
                </form>
            </div>
        </div>
    </nav>

    <!-- 欢迎区域 -->
    <div class="welcome-area">
        <div class="container">
            <div class="row align-items-center">
                <div class="col-lg-8 mx-auto text-center">
                    <h1 class="display-4">{{ site_title }}</h1>
                    <p class="lead mb-4">发现优质科技资源，助力技术创新</p>
                    <form class="d-flex justify-content-center">
                        <input class="form-control me-2" style="max-width: 400px;" type="search" placeholder="搜索您感兴趣的内容..." aria-label="Search">
                        <button class="btn btn-light" type="submit">搜索</button>
                    </form>
                </div>
            </div>
        </div>
    </div>

    <!-- 主要内容 -->
    <div class="container py-5">
        <div class="row g-4">
            {% for category in categories %}
            <div class="col-md-4">
                <div class="card h-100">
                    <div class="card-header">
                        <h5 class="card-title d-flex align-items-center">
                            <i class="fas fa-folder me-2 text-primary"></i>
                            <a href="/{{ category.name }}" class="text-decoration-none text-dark">
                                {{ category.name }}
                            </a>
                        </h5>
                    </div>
                    <div class="card-body">
                        <ul class="list-unstyled mb-0">
                            {% for bookmark in category.bookmarks[:5] %}
                            <li class="bookmark-item">
                                <a href="{{ bookmark.url }}" class="text-decoration-none d-flex align-items-center" target="_blank">
                                    {% if bookmark.icon %}
                                    <img src="{{ bookmark.icon }}" class="bookmark-icon" alt="icon">
                                    {% endif %}
                                    <span class="bookmark-title">{{ bookmark.title }}</span>
                                </a>
                            </li>
                            {% endfor %}
                        </ul>
                        {% if category.bookmarks|length > 5 %}
                        <div class="text-end mt-3">
                            <a href="/{{ category.name }}" class="btn btn-outline-primary">
                                查看更多
                                <i class="fas fa-arrow-right ms-1"></i>
                            </a>
                        </div>
                        {% endif %}
                    </div>
                </div>
            </div>
            {% endfor %}
        </div>
    </div>

    <!-- 页脚 -->
    <footer>
        <div class="container">
            <div class="row g-4">
                <div class="col-md-6">
                    <h5>关于本站</h5>
                    <p class="mb-0">这是一个基于浏览器书签生成的{{ site_title }}网站，致力于为用户提供优质的资源导航服务。我们精心筛选和整理各类资源，帮助用户快速找到所需内容。</p>
                </div>
                <div class="col-md-6 text-md-end">
                    <h5>联系我们</h5>
                    <p class="mb-0">如果您有任何问题或建议，欢迎随时与我们联系。</p>
                    <p class="mb-0 mt-2">&copy; 2024 {{ site_title }}. All rights reserved.</p>
                </div>
            </div>
        </div>
    </footer>

    <script src="static/vendor/bootstrap.bundle.min.js"></script>
    <script src="static/vendor/jquery.min.js"></script>
    <script src="static/js/main.js"></script>
</body>
</html> 